# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=py3-intervaltree
pkgver=3.1.0
pkgrel=1
pkgdesc="Editable interval tree data structure"
url="https://github.com/chaimleib/intervaltree"
arch="noarch"
license="Apache-2.0"
depends="
	py3-sortedcontainers
	python3
	"
makedepends="
	py3-gpep517
	py3-installer
	py3-setuptools
	py3-wheel
	"
subpackages="$pkgname-pyc"
source="https://pypi.python.org/packages/source/i/intervaltree/intervaltree-$pkgver.tar.gz"
builddir="$srcdir/intervaltree-$pkgver"
options="!check" # no tests ran

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m unittest discover
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
adb49726912ad6e9cf6c0985b4fb94df91b4ef54aa2eb327186d7f15bc992745d81654d49f1dd2ce95f7173683ba2a072787ef1e8b389cd9b7e23b9ae743906a  intervaltree-3.1.0.tar.gz
"
